#ifndef MANAGER_H
#define MANAGER_H

#include <QWidget>
#include"poco/saleBase.h"
#include"controller/managercontroller.h"

struct OrgJoin
{
    vector<User> users;
    vector<int> exam_ids;
};

struct WindowExam
{
    vector<WindowInfo> wins;
    vector<User> users;
    vector<int> exam_ids;
};

struct FoodExam{
    vector<SaleBase*> sales;
    vector<WindowInfo> wins;
};

namespace Ui {
class manager;
}

class manager : public QWidget
{
    Q_OBJECT

public:
    explicit manager(QWidget *parent = nullptr);
    ~manager();

    QString id;
    //设置用户信息
    void inform(QString id);
    //显示当前组织名称
    void cur_organ_show();
    void cur_organ_show1();
    //组织名称
    QStringList organ_name;
    QStringList busi_id;
    QStringList busi_name;
    QStringList organ_suc_name;
    QStringList organ_fail_name;
       void delete_organ(int i);
    //窗口审核
    QStringList window_address;
    QStringList window_name;
    QStringList user_name;
    QStringList user_phone;
    QStringList exaim_id;//审批id

    QStringList window_type;
    QStringList window_suc_name;
    QStringList window_fail_name;
    void delete_window(int i);
    void cur_window_show();
    void cur_window_show1();
    //菜品审核
    QStringList dish_picture;
    QStringList dish_name;
    QStringList dish_type;
    QStringList dish_price;
    QStringList dish_unit;
    QStringList dish_dirscription;
    QStringList dish_window_name;
    QStringList dish_suc_name;
    QStringList dish_fail_name;
    void delete_dish(int i);
    void cur_dish_show();
    void cur_dish_show1();
    void print_dish();

private slots:
    void on_join_approve_clicked();

    void on_window_approve_clicked();

    void on_dish_approve_clicked();

    void on_add_window_clicked();

    void on_join_success_clicked();

    void on_join_fail_clicked();

    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    //controller连接
private:
    ManagerController manCon;
    //加盟审批
    OrgJoin orgJoin;
    //窗口审批
    WindowExam windowExam;
    //食物审批
    FoodExam foodExam;

public:
    void setManagerController(ManagerController& manCon);

private:
    Ui::manager *ui;
};

#endif // MANAGER_H
